import {
  userGet,
  userPost,
  userPut,
  userDelete,
  resetPassword,
  updatePassword,
  roleGet,
  rolePost,
  rolePut,
  roleDelete,
  roleGetAll,
  permissionGet,
  permissionPost,
  permissionPut,
  permissionDelete,
  menuGet,
  menuPost,
  menuPut,
  menuDelete,
  menuTreeGet,
  menuTreeListGet,
  roleMenuSave,
  menuTreePermissionsGet,
  rolePermissionSave,
  logGet,
  dictGet,
  dictPost,
  dictPut,
  dictDelete
} from '@/api/manageApi'
const manage = {
  namespaced: true,
  state: {
  },
  getters: {},
  mutations: {
  },
  actions: {
    UserGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        userGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    UserPost ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        userPost(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    UserPut ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        userPut(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    UserDelete ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        userDelete(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    ResetPassword ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        resetPassword(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    UpdatePassword ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        updatePassword(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    RoleGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        roleGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    RolePost ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        rolePost(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    RolePut ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        rolePut(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    RoleDelete ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        roleDelete(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    RoleGetAll ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        roleGetAll(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    PermissionGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        permissionGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    PermissionPost ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        permissionPost(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    PermissionPut ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        permissionPut(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    PermissionDelete ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        permissionDelete(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },

    MenuGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        menuGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    MenuPost ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        menuPost(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    MenuPut ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        menuPut(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    MenuDelete ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        menuDelete(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    MenuTreeGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        menuTreeGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    MenuTreeListGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        menuTreeListGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    RoleMenuSave ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        roleMenuSave(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    MenuTreePermissionsGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        menuTreePermissionsGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    RolePermissionSave ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        rolePermissionSave(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    LogGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        logGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    DictGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        dictGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    DictPost ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        dictPost(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    DictPut ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        dictPut(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    DictDelete ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        dictDelete(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}
export default manage
